<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
       
        <div class="row">
            <div class="col-xs-6 col-xs-offset-3">
                <h3>笔记列表</h3>
                <div class="list-group">
                    <% for(let i = 0; i < data.length;i++){ %>
                    <span href="#" class="list-group-item"><%=data[i].title%> <a href="/delete/<%=data[i]._id%>" class="glyphicon glyphicon-remove pull-right" aria-hidden="true"></a></span>
                    
                   <% } %>
                  </div>
                  
                  <form action="/add" method="POST" role="form">
                    <legend>添加</legend>
                    <div class="form-group">
                        <label for="">标题</label>
                        <input type="text" class="form-control" name="title" placeholder="标题">
                    </div>
                    <div class="form-group">
                        <label for="">内容</label>
                        <textarea name="content" id="" cols="20" rows="5" class="form-control"></textarea>
                    </div>

                    <button type="submit" class="btn btn-primary">添加</button>
                  </form>
                  
            </div>
        </div>
        
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
</body>
</html>